/*
 * Copyright Owen Watson 2009
 * 
 * This file is part of ArtNotes.
 *
 * ArtNotes is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * ArtNotes is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with ArtNotes.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;

namespace ArtNotes
{

	/// <summary>
	/// Displays the 'About' screen
	/// </summary>
	[MonoTouch.Foundation.Register("ANAboutTabController")]
	public class ANAboutTabController : UIViewController
	{
		public ANAboutTabController (IntPtr p) : base(p)
		{
		}

		public ANAboutTabController ()
		{
		}
	
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			UIView aboutView = new UIView ();
			aboutView.BackgroundColor = UIColor.White;
			aboutView.SizeToFit ();
			aboutView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);
			
			//aboutView.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("Images/aboutScreen.png"));
			UIImageView anAboutScreen = new UIImageView (new RectangleF (0, 0, 320, 380));
			anAboutScreen.Image = UIImage.FromFile ("Images/aboutScreen.png");
			anAboutScreen.Frame = new RectangleF (0, 0, 320, 380);
			aboutView.AddSubview (anAboutScreen);
		
			UITextView anAboutTextPt1 = new UITextView (new RectangleF (0, 0, 200, 100));
			anAboutTextPt1.Editable = false;
			anAboutTextPt1.BackgroundColor = UIColor.Clear;
			anAboutTextPt1.Text = "Developed by\nOwen Watson and Kirk Barron\nCopyright 2009";
			anAboutTextPt1.Text += "\n\n";
			//anAboutText.Text += "Source available at http://code.google.com/p/artnotes";		
			anAboutTextPt1.TextAlignment = UITextAlignment.Center;
			anAboutTextPt1.Font = UIFont.FromName ("Marker Felt", 16);
			anAboutTextPt1.Frame = new RectangleF (130, 65, 200, 100);
			anAboutTextPt1.ScrollEnabled = false;
			aboutView.AddSubview (anAboutTextPt1);
			
			UITextView anAboutTextPt2 = new UITextView (new RectangleF (0, 0, 250, 100));
			anAboutTextPt2.Editable = false;
			anAboutTextPt2.BackgroundColor = UIColor.Clear;
			anAboutTextPt2.Text = "Source: http://code.google.com/p/artnotes\nBlog: http://artnotesdev.wordpress.com";		
			anAboutTextPt2.TextAlignment = UITextAlignment.Center;
			anAboutTextPt2.Font = UIFont.FromName ("Marker Felt", 14);
			anAboutTextPt2.Frame = new RectangleF (20, 165, 250, 100);
			anAboutTextPt2.ScrollEnabled = false;
			aboutView.AddSubview (anAboutTextPt2);
			
			this.View.AddSubview (aboutView);
		}
		
		public override void ViewWillDisappear (bool animated)
		{
			//UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
			Console.WriteLine ("About Tab Hidden");
		}
	
		public override void ViewWillAppear (bool animated)
		{
			//UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
			Console.WriteLine ("About Tab Visible");
		}
	}
}
